package com.dingreading.cloud.admin.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 总部员工-角色员工
 */
@Data
@Table(value = "admin_role_staff")
public class AdminRoleStaff implements Serializable {

    @Id(keyType = KeyType.Auto)
    private Long id;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(onInsertValue = "now()")
    private Date addTime;

    private String headStaffUid;

    private Long roleId;

    /**
     * 员工名
     */
    @Column(ignore = true)
    private String name;

    /**
     * 员工角色
     */
    @Column(ignore = true)
    @RelationOneToOne(
            selfField = "roleId",
            targetTable = "admin_roles",
            targetField = "id",
            valueField = "identify"
    )
    private String identify;

}
